package com.bw.user.mvvm.model;

import com.bw.mvvm_common.entity.BaseEntity;
import com.bw.mvvm_common.mvvm.model.BaseModel;
import com.bw.mvvm_common.network.HttpEnum;
import com.bw.mvvm_common.network.HttpFactory;

import java.util.HashMap;

import io.reactivex.Observable;

/**
 * @author KK
 * @description:
 * @date :2021/11/2 14:18
 */
public class OrderListModel extends BaseModel {

    //订单列表
    public Observable<BaseEntity> requestObserList(HashMap<String,Object> map){
        return changeFunc(changeFunc(HttpFactory.create(HttpEnum.TokenSign)
        .getRetrofit()
        .create(Api.class)
        .requestOrderList(createBody(map))));
    }

    //取消订单
    public Observable<BaseEntity> requestCannel(HashMap<String,Object> map){
        return changeFunc(changeFunc(HttpFactory.create(HttpEnum.TokenSign)
                .getRetrofit()
                .create(Api.class)
                .requestCannel(createBody(map))));
    }

    //确认收货
    public Observable<BaseEntity> requestConfirm(HashMap<String,Object> map){
        return changeFunc(changeFunc(HttpFactory.create(HttpEnum.TokenSign)
                .getRetrofit()
                .create(Api.class)
                .requestConfirm(createBody(map))));
    }

    //支付sign
    public Observable<BaseEntity> requestpaySign(HashMap<String,Object> map){
        return changeFunc(changeFunc(HttpFactory.create(HttpEnum.TokenSign)
                .getRetrofit()
                .create(Api.class)
                .requestPaysign(createBody(map))));
    }

}
